<?php

namespace common\validate;

class DelayOrder extends BaseValidate
{
    // 验证规则
    protected $rule = [];

    public function scenePendingDelayTaskGroupList()
    {
        return $this->append("param.filter.task_ids", "require|array");
    }

    public function sceneCreateDelayOrder()
    {
        return $this->append("data", "require|array")
            ->append("data.episode_id", "require")
            ->append("data.step_category_id", "require")
            ->append("data.reviewers", "require|array")
            ->append("data.delay_task_list", "require");
    }

    public function sceneCreateDelayOrderArray()
    {
        return $this->append("episode_id", "require")
            ->append("step_category_id", "require")
            ->append("delay_task_list", "require");
    }

    public function sceneDelayOrderList()
    {
        return $this->append("param.filter", "require|array");
    }

    public function sceneDelayOrderDetail()
    {
        return $this->append("param.filter.delay_order_id", "require");
    }

    public function sceneCreateDelayOrderItem()
    {
        return $this->append("delay_time", "require|integer")
            ->append("task_id", "require|integer");
    }

    public function sceneGetStepCategoryDelayReason()
    {
        return $this->append("param.filter.step_category_id", "require");
    }

    // SelectReview 验证场景定义
    public function sceneSelectReview()
    {
        return $this
            ->append("param.project_id", "require|integer")
            ->append("param.step_category_id", "require|integer");
    }

    public function sceneCheckDelayOrderReviewer()
    {
        return $this
            ->append("role_code", "require")
            ->append("user_id", "require|integer");
    }

    // EffectedTaskList 验证场景定义
    public function sceneEffectedTaskList()
    {
        return $this
            ->append("param.delay_order_id", "require|integer");
    }

    public function findDelayOrderTaskReviewProgress()
    {
        return $this
            ->append("param.filter.task_id", "require|integer");
    }

    // DelayModuleStepCategoryList 验证场景定义
    public function sceneDelayModuleStepCategoryList()
    {
        return $this
            ->append('param.step_category_id|环节id', 'require|integer')
            ->append('param.project_id|项目id', 'require|integer');
    }

    public function sceneManagerConfirm()
    {
        return $this
            ->append('param.delay_order_id_list|延期单ID列表', 'require|array')
            ->append('param.confirm_status|确认状态', 'require|in:yes,no');
    }

    // ConfirmedCheck 验证场景定义
    public function sceneConfirmedCheck()
    {
        return $this
            ->append('param.delay_order_id_list|延期单ID列表', 'require|array');
    }
}
